﻿using Super.Admin.Entities;

namespace Super.Admin.IServices
{
    /// <summary>
    /// 权限服务接口类
    /// </summary>
    public interface IPermissionService
    {
        /// <summary>
        /// 获取所有菜单
        /// </summary>
        /// <returns></returns>
        IReadOnlyCollection<PermissionEntity> GetPermissionMenus();
        /// <summary>
        /// 获取所有权限
        /// </summary>
        /// <returns>权限实体集合</returns>
        IReadOnlyCollection<PermissionEntity> GetPermissions();
        /// <summary>
        /// 获取所有权限
        /// </summary>
        /// <param name="menutype">权限类型</param>
        /// <returns>权限实体集合</returns>
        IReadOnlyCollection<PermissionEntity> GetPermissions(int permissionType);
        /// <summary>
        /// 获取权限通过角色Ids
        /// </summary>
        /// <param name="roleIdList">角色权限Id</param>
        /// <returns>权限实体集合</returns>
        IReadOnlyCollection<PermissionEntity> GetPermissionsByUserRoleIds(IEnumerable<int> roleIds);
        /// <summary>
        /// 添加权限
        /// </summary>
        /// <param name="permission">新增的权限实体</param>
        void CreatePermission(PermissionEntity permission);
        /// <summary>
        /// 修改权限
        /// </summary>
        /// <param name="permissionEntity">需要修改的权限实体</param>
        void UpdatePermission(PermissionEntity permission);
        /// <summary>
        /// 删除权限
        /// </summary>
        /// <param name="permissionId">权限ID</param>
        void DeletePermission(int permissionId);
    }
}
